package com.csist.service.bo.impl;

import com.csist.mapper.bo.LevelRegistrationBoMapper;
import com.csist.pojo.bo.LevelRegistrationBo;
import com.csist.service.bo.LevelRegistrationBoService;
import com.csist.util.SqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @ClassName LevelRegistrationBoServiceImpl
 * @Description 【自行描述】
 * @Author cn
 * @Date 2024/6/26 17:31
 * @Version 1.0
 */
public class LevelRegistrationBoServiceImpl implements LevelRegistrationBoService {
    private SqlSession sqlSession;
    private LevelRegistrationBoMapper levelRegistrationBoMapper;

    public LevelRegistrationBoServiceImpl() {
        sqlSession = SqlSessionUtil.openSession();
        levelRegistrationBoMapper = sqlSession.getMapper(LevelRegistrationBoMapper.class);
    }

    @Override
    public List<LevelRegistrationBo> selectAllLevelRegistration() {
        return levelRegistrationBoMapper.selectAllLevelRegistration();
    }

    @Override
    public LevelRegistrationBo selectSpecialtyLevelRegistrationById(int id) {
        return levelRegistrationBoMapper.selectSpecialtyLevelRegistrationById(id);
    }

    @Override
    public LevelRegistrationBo selectUndergraduateLevelRegistrationById(int id) {
        return levelRegistrationBoMapper.selectUndergraduateLevelRegistrationById(id);
    }
    @Override
    public LevelRegistrationBo selectLevelRegistrationBoByUestcId(String id) {
        LevelRegistrationBo levelRegistrationBo = levelRegistrationBoMapper.selectLevelRegistrationBoByUestcId(id);
        if (levelRegistrationBo != null) {
            return levelRegistrationBo;
        }
        return null;
    }
}
